Variant_Type="Missense_Mutation|Nonsense_Mutation|Frame_Shift_Ins|Frame_Shift_Del|In_Frame_Ins|In_Frame_Del|Splice_Site|Nonstop_Mutation"

smg_gene=`cat ${config_path}/Check_Gene.list  | head -1`
noncoding_gene=`cat ${config_path}/Check_Gene.list  | tail -1`

## 关注基因的列名
echo "Tumor,Normal,EGFR_raw,EGFR_qc,TP53_raw,TP53_qc,KRAS_raw,KRAS_qc,ERBB2_raw,ERBB2_qc,RB1_raw,RB1_qc,PTEN_raw,PTEN_qc,CTNNB1_raw,CTNNB1_qc,WDFY4_raw,WDFY4_qc,CSMD3_raw,CSMD3_qc,ZFHX4_raw,ZFHX4_qc" \
> ${vcf_qc_path}/Record.filterSMG.csv
echo "Tumor,Normal,SFTPB_raw,SFTPB_qc,LAMB3_raw,LAMB3_qc,MALAT1_raw,MALAT1_qc,NEAT1_raw,NEAT1_qc" \
> ${vcf_qc_path}/Record.noncoding.csv

## 记录原始的和质控以后基因的改变
for line in `cat ${work_dir}/config/GRCh38_Batch13_final.csv | grep -v Normal` 
do
echo $line
Tumor=` echo $line | awk -F, '{print$1}' `
Normal=` echo $line | awk -F, '{print$2}' `
## SMG
tmp=""
for gene in `echo ${smg_gene} | tr '|' '\n'`
do
raw_gene_line=`cat ${maf_path}/${Tumor}_${Normal}.filterStep1.maf | awk -F'\t' '{ if($1==gene && $9~Variant_Type){print} }' gene=${gene} Variant_Type=${Variant_Type} | wc -l`
qc_gene_line=`cat ${vcf_qc_path}/${Tumor}_${Normal}_MutQc.KeepMut.csv | awk -F',' '{ if($2==gene && $3~Variant_Type){print} }' gene=${gene} Variant_Type=${Variant_Type} | wc -l`
tmp=${tmp}","${raw_gene_line}","${qc_gene_line}
done
echo ${Tumor},${Normal}${tmp} >> ${vcf_qc_path}/Record.filterSMG.csv
## noncoding
tmp=""
for gene in `echo ${noncoding_gene} | tr '|' '\n'`
do
raw_gene_line=`cat ${maf_path}/${Tumor}_${Normal}.filterStep1.maf | awk -F'\t' '{ if($1==gene ){print} }' gene=${gene} | wc -l`
qc_gene_line=`cat ${vcf_qc_path}/${Tumor}_${Normal}_MutQc.KeepMut.csv | awk -F',' '{ if($2==gene ){print} }' gene=${gene} | wc -l`
tmp=${tmp}","${raw_gene_line}","${qc_gene_line}
done
echo ${Tumor},${Normal}${tmp} >> ${vcf_qc_path}/Record.noncoding.csv
done